<div class="headertitle">
	<span class="header">Sub Forums</span>
</div>
<?php echo $this->Html->link("Add a new forum", array("controller" => "forums", "action" => "add")); ?>

<?php echo $this->Form->Create(array("controller" => "forums", "action" => "delete")); ?>
<table cellpadding="0" cellspacing="0" id="forumssortable">
	<thead>
		<tr>
			<th style="width: 1px"></th>
			<th style="width: 1px"></th>
			<th>Name</th>
			<th>Forum</th>
			<th>Created</th>
			<th>Modified</th>
			<th style="width: 1px">ID</th>
		</tr>
	</thead>
	<tbody>
	<?php foreach($forums as $forum): ?>
		<tr id="forum_<?php echo $forum['Forum']['id']; ?>">
			<td><?php echo $this->Form->checkbox("selectedForums.", array("value" => $forum['Forum']['id'], "hiddenField" => false)); ?></td>
			<td><?php echo $this->Html->link($this->Html->image('icons/pencil.png'), array("controller" => "forums", "action" => "edit/" . $forum['Forum']['id']), array("escape" => false)); ?></td>
			<td><?php echo $forum['Forum']['name']; ?></td>
			<td><?php echo count($forum['SubForum']); ?></td>
			<td><?php echo $forum['Forum']['created']; ?></td>
			<td><?php echo $forum['Forum']['modified']; ?></td>
			<td><?php echo $forum['Forum']['id']; ?></td>
		</tr>
	<?php endforeach; ?>
	</tbody>
</table>
<?php echo $this->Form->End('Delete Selected'); ?>